<?php

class View_Helper_PrintPets extends Model3_View_Helper
{

    public function PrintList($pets,$view)
    {
        if(is_array($pets) && count($pets)>0)
        {
            foreach ($pets as $pet) {
                $this->drawPetSimple($pet,$view);
            }
        }
        else
        {
            ?>
            <div class="notice"> No se encontraron mascotas.</div>
            <?php
        }
    }
    
    public function drawPetSimple($pet,$view)
    {
        // dibujar solo uno
       ?>
            <div>
                <div class="span-5"> <?php echo $view->ManagerImages()->thumbImg($pet['image'],'Foto','Foto','', '160','100');?> </div>
                <div class="span-10"> 
                    <div>
                        <h3><?php echo $pet['name'];?></h3>
                        <i><?php echo $pet['description'];?></i>
                    </div>
                </div>
                <div class="span-1">
                    <a href="<?php echo $view->url(array('controller'=>'PetProfile','action'=>'index','petId'=>$pet['id']))?>">
                          <?php echo $view->ManagerImages()->img('images/layout/maspatas/+.jpg','mas informacion','mas informacion'); ?> 
                        </a>
                </div>
            </div>
            <hr>
                
        <?php
    }
}